import java.util.Scanner ;
import java.util.Set;
import java.util.TreeSet;
public class Main {
		public static void main(String[] args) {
			Scanner sc = new Scanner(System.in) ;
		Set<String> set = new TreeSet<String>() ;
		while(true)
		{
			String word = sc.next() ;
			if("!!!!!".equals(word))
				break ;
			if(",".equals(word))
				continue ;
			set.add(word);
		}
		int foot = 0;
		System.out.println(set.size());
		for (String e : set) {
			if(foot == 10)
				break ;
			System.out.println(e);
			foot ++ ;
		}
		sc.close();
	}
}